#ifndef _ALAPFORM_H_
#define _ALAPFORM_H_

#include <FBase.h>
#include <FUi.h>
#include <FUix.h>

class AlapForm :
	public Osp::Ui::Controls::Form,
	public Osp::Ui::IActionEventListener,
	public Osp::Uix::IMotionEventListener
{

// Construction
public:
	AlapForm(void);
	virtual ~AlapForm(void);
	bool Initialize(void);

// Implementation
protected:
	static const int ID_BUTTON_OK = 101;
	Osp::Ui::Controls::Button *__pButtonOk;
	Osp::Ui::Controls::Label *__pLastEventLabel;
	Osp::Ui::Controls::Label *__pSnapLabel;
	Osp::Ui::Controls::Label *__pShakeLabel;
	Osp::Ui::Controls::Label *__pTapLabel;

	int taps;
	int snaps;
	int shakes;

	Osp::Uix::Motion * motion;

public:
	virtual result OnInitializing(void);
	virtual result OnTerminating(void);
	virtual void OnActionPerformed(const Osp::Ui::Control& source, int actionId);

	void OnShakeDetected(Osp::Uix::MotionState motionState);
	void OnSnapDetected(Osp::Uix::MotionSnapType snapType);
	void OnDoubleTapDetected(void);
};

#endif	//_ALAPFORM_H_
